<!--
/**************************************************
* @ manufacturequery.jsp
*
* Copyright   2005 Hitrust Technology Inc.
* Developed by SDC, Hitrust.
* All Rights Reserved.
*
* Modify History:
*  v1.00, 2006/03/22, owen
*  1) first release
/**************************************************
-->
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ include file="../common.jsp" %>

<%@ taglib uri="/page.util.gs.hitrust.com/taglibs/page" prefix="page"%>
<%@page import="framework.core.Conditions"%>
<%@page import="framework.core.DBConnection"%>
<%@page import="framework.core.ObjectList"%>
<%@page import="system.base.ProductTypeManager"%>
<%@page import="system.data.ProductTypeManagerBase" %>
<%@ page import="system.*"%>
<%@ page import="system.base.*"%>
<%@page import="utils.system"%><html>
<head>
<title>产品管理</title>
<META http-equiv=Content-Type content="text/html; charset=UTF-8">
<LINK href="<%=root%>/css/caigouxitong.css" type=text/css rel=stylesheet>
<SCRIPT language="JavaScript" src="<%=root%>/js/calendar.js"></SCRIPT>
<SCRIPT language="JavaScript" src="<%=root%>/js/common.js"></SCRIPT>
<SCRIPT language="JavaScript" src="<%=root%>/js/string.js"></SCRIPT>
<SCRIPT language=javascript src="<%=root%>/framework/js/datePicker/WdatePicker.js"></SCRIPT>
<%

	String tReQuery = (String)request.getAttribute("requery");
	ArrayList tManuf1 = (ArrayList)request.getAttribute("manufacture1");
	HashMap tMap1 = (HashMap)request.getAttribute("manufacturetyp2");
	HashMap tMap2 = (HashMap)request.getAttribute("manufacturetyp3");
	ArrayList tList1 = new ArrayList();    
	ResultProcess tGSManuf = (ResultProcess)request.getAttribute("manufacture");
	ArrayList tList = new ArrayList();
	String [] tStr = null;
    String ma=GSSystemConfigurator.getParam("gs.ManufactureAdd");
    ArrayList wareHouse=(ArrayList)request.getAttribute("wareHouse");
    String isPlanPrice = (String)request.getAttribute("isPlanprice");
    LoginContext loginInfo =(LoginContext)request.getSession().getAttribute("LoginContext");
	User user=loginInfo.getUser();
	boolean isTel=user.getTel().equals("1");
	if(isTel){
		isPlanPrice="1";
	}
    ObjectList productTypeManager1 = (ObjectList)request.getAttribute("productTypeManager1");
    ObjectList productTypeManager2 = (ObjectList)request.getAttribute("productTypeManager2");
    
%>
<script language="JavaScript">
	var counter;
	var flag=false;
	function process(){
		if(flag){
			alert("查询正在执行，请稍候！");
			return false;
		}else{
		var tStr = "";
		var tEnd = "";
		if(!isEmpty(manufactureform.manufactureRecordDateStr.value)){
			tStr = manufactureform.manufactureRecordDateStr.value.substr(0,4) + manufactureform.manufactureRecordDateStr.value.substr(5,2) + manufactureform.manufactureRecordDateStr.value.substr(8,2);

		}
		if(!isEmpty(manufactureform.manufactureRecordDateEnd.value)){
			tEnd = manufactureform.manufactureRecordDateEnd.value.substr(0,4) + manufactureform.manufactureRecordDateEnd.value.substr(5,2) + manufactureform.manufactureRecordDateEnd.value.substr(8,2);
		}
		if(parseInt(tStr) > parseInt(tEnd)){
				alert("产品录入周期的开始日期不能大于截止日期！");
				return false;
		}
		manufactureform.iskeywordquery.value="F";
		manufactureform.action = "<%= response.encodeURL(request.getContextPath() + "/A400302.do") %>";
		manufactureform.submit();
		flag=true;
		}
	}
	
	function processkey(){
		manufactureform.iskeywordquery.value="T";
		manufactureform.action = "<%= response.encodeURL(request.getContextPath() + "/A400302.do") %>";
		manufactureform.submit();
	}
	
	function mod(temp){
        if('<%=ma%>'=='true'){
            mod2(temp);
        }else{
            var id=null;
            id= temp;
            window.open("<%= response.encodeURL(request.getContextPath() + "/A400306.do") %>?manufactureid="+id);
        }
    }
    function mod2(temp){
      var id=temp;
      var result="";
      result=showModalDialog("<%= response.encodeURL(request.getContextPath() + "/A400316.do") %>?manufactureid="+id,"","status:no;unadorned:no;dialogWidth:900px;dialogHeight:600px;help:no;");
      if(result!=null){
      var isPlanPrice = <%=isPlanPrice%>;
      if(isPlanPrice==1){
                manufacturemod.manuftype4.value=result[0];
                manufacturemod.manuftype5.value=result[1];
                manufacturemod.manuftype6.value=result[2];
                manufacturemod.manufacturecode.value=result[3];
                manufacturemod.concentricityid.value=result[4];
                manufacturemod.manufacturename.value=result[5];
                manufacturemod.providerid.value=result[6];
                manufacturemod.unitprice.value=result[7];
                manufacturemod.quantunit.value=result[8];
                manufacturemod.manufacturetype.value=result[9];
                manufacturemod.manfuacturespec.value=result[10];
                manufacturemod.qualityassureperiod.value=result[11];
                manufacturemod.manufacturername.value=result[12];
                manufacturemod.makearea.value=result[13];
                manufacturemod.manufacturebrand.value=result[14];
                manufacturemod.drawingpiececode2.value=result[15];
                manufacturemod.isbuy2.value=result[16];
                manufacturemod.machinetype.value=result[17];
                manufacturemod.property.value=result[18];
                manufacturemod.remark.value=result[19];
                manufacturemod.mode2.value=result[20];
                manufacturemod.concentricity_code_back.value=result[21];
                manufacturemod.planprice.value=result[22];
                manufacturemod.producttype.value = result[23];
                manufacturemod.productbid.value = result[24];
                manufacturemod.kmqualityassureperiod.value=result[25];
                manufacturemod.balancecustomercode.value=result[26];
                manufacturemod.pic.value=result[27];
                manufacturemod.action="<%= response.encodeURL(request.getContextPath() + "/A400317.do") %>";
                manufacturemod.submit();
            }else{
                manufacturemod.manuftype4.value=result[0];
                manufacturemod.manuftype5.value=result[1];
                manufacturemod.manuftype6.value=result[2];
                manufacturemod.manufacturecode.value=result[3];
                manufacturemod.concentricityid.value=result[4];
                manufacturemod.manufacturename.value=result[5];
                manufacturemod.providerid.value=result[6];
                manufacturemod.unitprice.value=result[7];
                manufacturemod.quantunit.value=result[8];
                manufacturemod.manufacturetype.value=result[9];
                manufacturemod.manfuacturespec.value=result[10];
                manufacturemod.qualityassureperiod.value=result[11];
                manufacturemod.manufacturername.value=result[12];
                manufacturemod.makearea.value=result[13];
                manufacturemod.manufacturebrand.value=result[14];j
                manufacturemod.drawingpiececode2.value=result[15];
                manufacturemod.isbuy2.value=result[16];
                manufacturemod.machinetype.value=result[17];
                manufacturemod.property.value=result[18];
                manufacturemod.remark.value=result[19];
                manufacturemod.mode2.value=result[20];
                manufacturemod.concentricity_code_back.value=result[21];
                manufacturemod.producttype.value = result[22];
                manufacturemod.productbid.value = result[23];
                manufacturemod.kmqualityassureperiod.value=result[24];
                manufacturemod.balancecustomercode.value=result[25];
                manufacturemod.pic.value=result[26];
                manufacturemod.action="<%= response.encodeURL(request.getContextPath() + "/A400317.do") %>";
                manufacturemod.submit();
            }
      }
    }
	function clean(){
        manufactureform.manufactureName.value          = "";
        manufactureform.concentricityId.value          = "";			
        manufactureform.istradeflatmanufacture.value   = "";
        manufactureform.manufactureSpec.value          = "";
        manufactureform.manufactureType.value          = "";
        manufactureform.manufactureBrand.value         = "";
        manufactureform.manufacturerName.value         = "";            
        manufactureform.drawingpiececode.value         = "";            
        manufactureform.provider.value                 = "";
        manufactureform.isBuy.value                    = "1"; 
        manufactureform.isPic.value                    = ""; 
        manufactureform.manufactureRecordDateStr.value = "";
        manufactureform.manufactureRecordDateEnd.value = "";
		manufactureform.warehousecode.value="";	
        manufactureform.manuftype1.value="0";
        var listbox2    = document.getElementById("manuftype2");
        listbox2.length = 0;
        var option2     = new Option();
        option2.text    = "---二级---";
        option2.value   = "0";			
        listbox2.options[listbox2.length] = option2;
			
        var listbox3    = document.getElementById("manuftype3");
        listbox3.length = 0;
        var option3     = new Option();
        option3.text    = "---三级---";
        option3.value   = "0";			
        listbox3.options[listbox3.length] = option3;
        
        var listbox4    = document.getElementById("gsValidity");
        listbox4.text  = "---全部---";
        listbox4.value  = "";
        
        var listbox5    = document.getElementById("providerStatus");
        listbox5.text  = "---全部---";
        listbox5.value  = "";
        
        var listbox6    = document.getElementById("productType");
        listbox6.text  = "---全部---";
        listbox6.value  = "";
	}
  
	function change1(optval){
        var val = optval;
        if(val=='0'){
            var listbox = document.getElementById("manuftype2");
            listbox.length = 0;
            var option = new Option();
            option.text = "---二级---";
            option.value = "0";
            listbox.options[listbox.length] = option;
            change2(optval);
        }else{
            var counter="0";
    <%
    if(tMap1 !=null){
        Collection tCollection = tMap1.keySet();
        Iterator tIterator = tCollection.iterator();
        while(tIterator.hasNext()){
            String tKey = (String)tIterator.next();
            tList1 = (ArrayList)tMap1.get(tKey);
    %>
            if(val == '<%=tKey%>'){
                counter = "1";
                var listbox = document.getElementById("manuftype2");
                listbox.length = 0;
                var option = new Option();
                option.value = "0";
                option.text = "---二级---";
                listbox.options[listbox.length] = option;
    <%
    for(int n=0;n<tList1.size();n++){
        GSManufactureCategoryBean tGSManufactureBean = (GSManufactureCategoryBean)tList1.get(n);
        String categoryId = tGSManufactureBean.getGs_manufacture_category_id();
        String categoryName = tGSManufactureBean.getGs_manufacture_category_name();
    %>
                var temp1 = '<%=categoryId%>';
                var temp2 = '<%=categoryName%>';
                var option = new Option();
                option.value = temp1;
                option.text = temp2;
                listbox.options[listbox.length] = option;
    <%
    }
    %>
                change2('0');           
            }
         
    <%
    }
    %>
            if(counter == '0'){
                var listbox = document.getElementById("manuftype2");
                listbox.length = 0;
                var option = new Option();
                option.value = "0";
                option.text = "---二级---";
                listbox.options[listbox.length] = option;  
                change2('0');    	
            }
    <%  
    }
    %>
        }
    }
    
    function change2(optval){
      var val = optval;
      if(val=='0'){
            var listbox = document.getElementById("manuftype3");
            listbox.length = 0;
            var option = new Option();
            option.text = "---三级---";
            option.value = "0";
            listbox.options[listbox.length] = option;
      }else{
            var counter = "0";
    <%
    if(tMap2 !=null){
        Collection tCollection = tMap2.keySet();
        Iterator tIterator = tCollection.iterator();
        while(tIterator.hasNext()){
            String tKey = (String)tIterator.next();
            tList1 = (ArrayList)tMap2.get(tKey);
    %>
            if(val == '<%=tKey%>'){
                counter = "1";
                var listbox = document.getElementById("manuftype3");
                listbox.length = 0;
                var option = new Option();
                option.text = "---三级---";
                option.value = "0";
                listbox.options[listbox.length] = option;
    <%
                for(int n=0;n<tList1.size();n++){
                    GSManufactureCategoryBean tGSManufactureBean = (GSManufactureCategoryBean)tList1.get(n);
                    String categoryId = tGSManufactureBean.getGs_manufacture_category_id();
                    String categoryName = tGSManufactureBean.getGs_manufacture_category_name();%>
                            var temp1 = '<%=categoryId%>';
                            var temp2 = '<%=categoryName%>';
                            var option = new Option();
                            option.value = temp1;
                            option.text = temp2;
                            listbox.options[listbox.length] = option;
    <%
                }
    %>
            }
    <%
        }
    %>
            if(counter == '0'){
                var listbox = document.getElementById("manuftype3");
		        listbox.length = 0;
		        var option = new Option();
		        option.text = "---三级---";
		        option.value = "0";
		        listbox.options[listbox.length] = option;          
            }
    <%
    }
    %>
      }
    }
    

    
	function openwin(value){
		showModalDialog("<%=root%>/jsp/showimage.jsp?path="+value,window,"status:no;unadorned:yes;dialogWidth:375px;dialogHeight:400px;help:no;");
	}
	function downExcel(){
     	
        <%if(tGSManuf != null){
            int totalRecords = 0;
            if(request.getAttribute("totalRecords")!=null){
                totalRecords=Integer.parseInt((String)request.getAttribute("totalRecords"));
            }
            if(totalRecords>32000){
        %>
                alert("导出EXCEL产品数量不能超过32000条！");
                return false;
         <%   }else{%>
                window.location.href="<%= response.encodeURL(request.getContextPath() + "/GSmanufactureDown") %>"
          <%  }}
         %>

    }
	function init()
	{
    <%
        if( tReQuery!=null && tReQuery.equals("true") )
        {
    %>
            var mkey= "<%=request.getAttribute("iskeywordquery")%>";
            if(mkey=='T'){
                processkey();
            }else if(mkey=='F') {
                process();
            }
    <%
        }
    %>		
	}
  	
	function viewWinMaxWindow(sUrl)
	{
	    window.open(sUrl,"_blank","height="+(window.screen.availHeight-50)+",width="+(window.screen.availWidth-80)+",left=20,top=20,menubar=no,scrollbars=yes");
	}
</script>

</head>
<body BGCOLOR="#f2f2f2"	text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="init()">
<form name="manufactureform" method="get" >
<input type='hidden' name='iskeywordquery' value='<%=request.getParameter("iskeywordquery")==null?"":request.getParameter("iskeywordquery") %>'>
<input type='hidden' name='gsManufacture'>

<p><br></p>
<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td height="20"> 
      <table width="100%" border="0" cellspacing="0" cellpadding="1">
        <tr height="20">
          <td height="20" width="1" class="mtxt_black">&nbsp;</td>
          <td height="30" width="758" class="mtxt_black">产品管理</td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td class="bg_line" height="2"></td>
  </tr>
</table>
<br>
<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr> 
		<td> 
			<table class=bg_table id=tableId	cellspacing=1 cellpadding=0 style="padding-left:5;padding-right:5" width=100% align=center border=0>
				
				<tr height=20>
					<td class ="bg_column" align=center>产品分类</TD>
					<td align ="left" class="bg_row_odd">
						<select name="manuftype1" onChange="change1(this.value)">	
						<option value="0">---一级---</option>				
    <%
    String tManufType1 = request.getParameter("manuftype1");
    if(tManuf1 != null && tManuf1.size() > 0 ){
        for(int i=0; i<tManuf1.size(); i++){
            GSManufactureCategoryBean tGSManufactureBean = (GSManufactureCategoryBean)tManuf1.get(i);
            if(tManufType1!=null && tManufType1.equals(tGSManufactureBean.getGs_manufacture_category_id())){
    %>
						<option value="<%=tGSManufactureBean.getGs_manufacture_category_id()%>" selected><%=tGSManufactureBean.getGs_manufacture_category_name()%></option>
    <%			        
            }else{
    %>
                        <option value="<%=tGSManufactureBean.getGs_manufacture_category_id()%>"><%=tGSManufactureBean.getGs_manufacture_category_name()%></option>
    <%			
            }	
        }
    }
    %>
						</select>
						<select id="manuftype2" name="manuftype2" onChange="change2(this.value)">	
						<option value="0">---二级---</option>				
    <%
    String tManufType2 = request.getParameter("manuftype2");
    if(tManufType1 != null && !tManufType1.equals("0")){
        ArrayList temp = (ArrayList)tMap1.get(tManufType1);
        if(temp!=null){
            for(int i=0; i<temp.size(); i++){
                GSManufactureCategoryBean tGSManuf2 = (GSManufactureCategoryBean)temp.get(i);
                if(tManufType2!=null && tManufType2.equals(tGSManuf2.getGs_manufacture_category_id())){
    %>
                        <option value="<%=tManufType2%>" selected><%=tGSManuf2.getGs_manufacture_category_name()%></option>
    <%			        
                }else{
    %>
                        <option value="<%=tGSManuf2.getGs_manufacture_category_id()%>"><%=tGSManuf2.getGs_manufacture_category_name()%></option>
								
    <%			}	
            }
		}
	}
    %>
						</select>
						<select name="manuftype3" id="manuftype3">	
						<option value="0">---三级---</option>				
    <%
    String tManufType3 = request.getParameter("manuftype3");
    if(tManufType2 != null && !tManufType2.equals("0") ){
        ArrayList temp = (ArrayList)tMap2.get(tManufType2);
        if(temp!=null){
            for(int i=0; i<temp.size(); i++){
                GSManufactureCategoryBean tGSManuf3 = (GSManufactureCategoryBean)temp.get(i);
                if(tManufType3!=null && tManufType3.equals(tGSManuf3.getGs_manufacture_category_id())){
   %>
                        <option value="<%=tGSManuf3.getGs_manufacture_category_id()%>" selected><%=tGSManuf3.getGs_manufacture_category_name()%></option>
   <%			        
                }else{
   %>
						<option value="<%=tGSManuf3.getGs_manufacture_category_id()%>"><%=tGSManuf3.getGs_manufacture_category_name()%></option>
								
   <%			
                }	
			}
		}
	}
   %>
                	</select>
            
					</td>	
					<td class="bg_column" align="center">产品类型</td>
					<td align ="left" class="bg_row_odd">
						  <select name="istradeflatmanufacture">					
						     <option value="">---全部---</option>
    <%
    String tIstradeflatmanufacture = (String)request.getAttribute("istradeflatmanufacture");
    String[][] tTradeflat = GSBaseManager.getProductType();
    if(tTradeflat != null && tTradeflat.length > 0 ){
        for(int i=0; i<tTradeflat.length; i++){
            String[] temp = tTradeflat[i];
            if(tIstradeflatmanufacture != null && tIstradeflatmanufacture.equals(temp[0])){
    %>
                            <option value="<%=temp[0]%>" selected><%=temp[1]%></option>
    <%				    
            }else{
    %>
                            <option value="<%=temp[0]%>" ><%=temp[1]%></option>
    <%			
			}
		}
	}
    %>
                            </select>
				    </td>					
				</tr>
                <tr height=20>
                    <td class="bg_column" align=center>集中编码</TD>
                    <td align=left class="bg_row_odd" width="300"><input type="text" name="concentricityId" value="<%=request.getParameter("concentricityId")==null? "":request.getParameter("concentricityId") %>"></td>                   
                    <td class="bg_column" align=center width="100">产品名称</td>
                    <td align=left class="bg_row_odd" ><input type="text" name="manufactureName" value="<%=request.getParameter("manufactureName")==null? "":request.getParameter("manufactureName") %>"></td>                  
                </tr>
                <tr height=20>
                    <td class="bg_column" align=center>规格</TD>
                    <td align=left class="bg_row_odd" width="300"><input type="text" name="manufactureSpec" value="<%=request.getParameter("manufactureSpec")==null? "":request.getParameter("manufactureSpec") %>"></td>                   
                    <td class="bg_column" align=center width="100">型号</td>
                    <td align=left class="bg_row_odd" ><input type="text" name="manufactureType" value="<%=request.getParameter("manufactureType")==null? "":request.getParameter("manufactureType") %>"></td>                  
                </tr>
				<tr height=20>
					<td class="bg_column" align=center>品牌</TD>
					<td align=left class="bg_row_odd" width="300"><input type="text" name="manufactureBrand" value="<%=request.getParameter("manufactureBrand")==null? "":request.getParameter("manufactureBrand") %>"></td>					
					<td class="bg_column" align=center width="100">生产厂商</td>
					<td align=left class="bg_row_odd" ><input type="text" name="manufacturerName" value="<%=request.getParameter("manufacturerName")==null? "":request.getParameter("manufacturerName") %>"></td>					
				</tr>
                <tr height=20>
                  <td class="bg_column" align=center>供应商</td>
                  <td align=left class="bg_row_odd" width="300"><input type="text" name="provider" value="<%=request.getParameter("provider")==null? "":request.getParameter("provider") %>"></td>          
                  <td class="bg_column" align=center width="100">图件号</td>
                  <td align=left class="bg_row_odd" ><input type="text" name="drawingpiececode" value="<%=request.getParameter("drawingpiececode")==null? "":request.getParameter("drawingpiececode") %>"></td>         
                </tr>
                
                <tr height=20>
                  <td class="bg_column" align=center>是否有效产品</td>
                  <td align=left class="bg_row_odd" width="300">
                    <select id="gsValidity" name="gsValidity">
                        <option value="">---全部---</option>
                        <%String tValidity = (String)request.getParameter("gsValidity");
                        if(tValidity==null){%>
                        <option value="1">有效</option>
                        <option value="0">无效</option>
                        <%}else{
                        String[][] tGsValidity = GSBaseManager.getValidity();
                        if(tGsValidity != null && tGsValidity.length > 0 ){
                    
                                for(int i=0; i<tGsValidity.length; i++){
                                    String[] temp = tGsValidity[i];
                                    if(tValidity != null && tValidity.equals(temp[0])){
                        %>
                        
                                        <option value="<%=temp[0]%>" selected>
                                        <%=temp[1]%></option>
                        <%                  
                                    }else{
                        %>
                                        <option value="<%=temp[0]%>" >
                                        <%=temp[1]%></option>
                        <%          
                                    }
                                }
                            }
                        }
                        %>
                    </select>    
                  </td>          
                  <td class="bg_column" align=center width="100">供应商有效无效</td>
                  <td align=left class="bg_row_odd" >
                    <select id="providerStatus" name="providerStatus">
                        <option value="">---全部---</option>
                        <%String tProviderStatus = (String)request.getParameter("providerStatus");
                         if(tProviderStatus==null){%>
                        <option value="1">有效</option>
                        <option value="0">无效</option>
                        <%}else{
                        String[][] tGsProviderStatus = GSBaseManager.getValidity();
                        if(tGsProviderStatus != null && tGsProviderStatus.length > 0 ){
                    
                        for(int i=0; i<tGsProviderStatus.length; i++){
                                    String[] temp = tGsProviderStatus[i];
                                    if(tProviderStatus != null && tProviderStatus.equals(temp[0])){
                        %>
                                        <option value="<%=temp[0]%>" selected>
                                        <%=temp[1]%></option>
                        <%                  
                                    }else{
                        %>
                                        <option value="<%=temp[0]%>" >
                                        <%=temp[1]%></option>
                        <%          
                                    }
                                }
                            }
                        }
                        %>
                    </select> 
                       
                  </td>         
                </tr>
                
                <tr height=20>	
					<td class="bg_column" align=center>产品录入时间</td>
					<td align=left class="bg_row_odd">					
					<%=framework.custom.UIManager.generateDateInput("manufactureRecordDateStr",
							request.getParameter("manufactureRecordDateStr")==null?"":request.getParameter("manufactureRecordDateStr"))%>
					
					至
					<%=framework.custom.UIManager.generateDateInput("manufactureRecordDateEnd",
							request.getParameter("manufactureRecordDateEnd")==null?"":request.getParameter("manufactureRecordDateEnd"))%>
					</td>

                    <td class="bg_column" align=center>是否需采购</td>
                  <td align=left class="bg_row_odd">
                  <select name="isBuy">
                    <option value="">---全部---</option>
                    
                    
                    <%String tGsIsbuy = (String)request.getParameter("isBuy");
                    if(tGsIsbuy==null){%>
                        <option value="1" selected>是</option>
                        <option value="0">否</option>
                    <%}else{
                    
                    String[][] tIsbuy = GSBaseManager.getAllisbuy();
                    if(tIsbuy != null && tIsbuy.length > 0 ){
                    
                        for(int i=0; i<tIsbuy.length; i++){
                                    String[] temp = tIsbuy[i];
                                    if(tGsIsbuy != null && tGsIsbuy.equals(temp[0])){
                        %>
                                        <option value="<%=temp[0]%>" selected>
                                        <%=temp[1]%></option>
                        <%                  
                                    }else{
                        %>
                                        <option value="<%=temp[0]%>" >
                                        <%=temp[1]%></option>
                        <%          
                                    }
                                }
                            }
                        }
                        %>
                    
                  </select> 
                  </td>
				</tr>
                <tr height=20>
                  <td class="bg_column" align=center>结算模式</td>
                  <td align=left class="bg_row_odd">
                  <select name="balancemode">
                    <option value="" selected>---全部---</option>
                    <%String mode =request.getParameter("balancemode")==null?"":request.getParameter("balancemode") ;
                    if(mode==null){%>
                        <%
                            if(isPlanPrice.equals("0")){
                        %>
                        <option value="<%=GSBaseConstants.BALANCE_MODE2 %>"><%=DefineDic.getBalanceMode(GSBaseConstants.BALANCE_MODE2) %></option>   
                        <%}else{ %>
                        <option value="<%=GSBaseConstants.BALANCE_MODE1 %>"><%=DefineDic.getBalanceMode(GSBaseConstants.BALANCE_MODE1) %></option>
                        <option value="<%=GSBaseConstants.BALANCE_MODE2 %>"><%=DefineDic.getBalanceMode(GSBaseConstants.BALANCE_MODE2) %></option>                                  
                        <%}%>
                    <%}else{
                    
                    String[][] stocksstate = GSBaseManager.getbalancemode();
                    if(stocksstate != null && stocksstate.length > 0 ){
                        if(isPlanPrice.equals("1")){
                            String[] temp = stocksstate[1];
                            %>
                                <option value="<%=temp[0]%>" >
                                        <%=temp[1]%></option>
                            <% 
                        }else{
                        for(int i=0; i<stocksstate.length; i++){
                                    String[] temp = stocksstate[i];
                                    if(mode != null && mode.equals(temp[0])){
                        %>
                                        <option value="<%=temp[0]%>" selected>
                                        <%=temp[1]%></option>
                        <%                  
                                    }else{
                        %>
                                        <option value="<%=temp[0]%>" >
                                        <%=temp[1]%></option>
                        <%          
                                    }
                                }
                            }
                         }   
                        }
                        %>
                    
                  </select>
                  </td>
                  <td class="bg_column" align=center>所属仓库</td>
                  <td align=left class="bg_row_odd">
                  <select name="warehousecode">
                  <option value="">---全部---</option>
                  <%String code=request.getParameter("warehousecode")==null?"":request.getParameter("warehousecode") ;%>
                  <%
                  if(wareHouse!=null&&wareHouse.size()>0){
                     for(int i=0;i<wareHouse.size();i++){ 
                         GSWareHouseBean tmp=(GSWareHouseBean)wareHouse.get(i);
                         if(code.equals(tmp.getCode())){
                  %>
                  <option value="<%=tmp.getCode() %>" selected="selected"><%=tmp.getName() %></option>
                  <%}else{ %>
                  <option value="<%=tmp.getCode() %>"><%=tmp.getName() %></option>
                  <%}}} %>
                  </select>
                  </td>
                </tr>
                  <tr height=20>
                    <td class="bg_column" align=center>区域分类</TD>
                    <td align=left class="bg_row_odd" width="300">
                    	<select name="upperType" >
                    		<%
                    			String upperType = (String)(request.getParameter("upperType")==null?"":request.getParameter("upperType")); 
                    			GSProductTypeManagerDao productTypeManagerDao= new GSProductTypeManagerDao();
                    			Conditions managerConditions = new Conditions();
                    			managerConditions.add(" upper_type = 1000");
                    			managerConditions.add(" status='1' order by product_type");
                  		        DBConnection con = null;
                    			ObjectList productTypeManagerTypeList = ObjectList.getList();
                    			try{
                    				con = DBConnection.open();
                    				productTypeManagerTypeList = ProductTypeManager.fetch().search(con,managerConditions);
                    			}finally{
                    				if(con!=null){
                    					con.close();
                    				}
                    			}	 
                    		 
                    		 if(upperType==null){
                    	%>
                    		<option value="">---全部---</option>
                    				<%							for(int i=0;i<productTypeManagerTypeList.size();i++){
									ProductTypeManager productTypeManager = (ProductTypeManager)productTypeManagerTypeList.get(i);
								 %>
										<option value="<%=productTypeManager.getProductType() %>" ><%=productTypeManager.getTypeName() %></option>
								<%
									}
								 %>
                    		<%}else{ %>
                    		 <option value="">---全部---</option>
<%							for(int i=0;i<productTypeManagerTypeList.size();i++){
									ProductTypeManager productTypeManager = (ProductTypeManager)productTypeManagerTypeList.get(i);
								 %>
										<option value="<%=productTypeManager.getProductType() %>"  <%if(productTypeManager.getProductType().equals(String.valueOf(upperType))) {%> selected="selected"<%} %> ><%=productTypeManager.getTypeName() %></option>
								<%
									}
								 %>
                    		<%} %>
                    	
                    	</select>

                    </td>                   
                    <td class="bg_column" align=center width="100">分类</td>
                    <td align=left class="bg_row_odd" >
                    	<select name="productType">
                    	<%
                    	String productType = (String)(request.getParameter("productType")==null?"":request.getParameter("productType")); 
            			GSProductTypeManagerDao proTypeManagerDao= new GSProductTypeManagerDao();
            			Conditions conditions = new Conditions();
            			conditions.add(" upper_type = 2000");
            			conditions.add(" status='1' order by product_type ");
          		        DBConnection c = null;
            			ObjectList  bidTypeList = ObjectList.getList();
            			try{
            				con = DBConnection.open();
            				bidTypeList = ProductTypeManager.fetch().search(con,conditions);
            			}finally{
            				if(con!=null){
            					con.close();
            				}
            			}	 
            		
            			 if(productType==null){
                         	%>
                         		<option value="">---全部---</option>
                         				<%						for(int i=0;i<bidTypeList.size();i++){
     									ProductTypeManager productTypeManager = (ProductTypeManager)bidTypeList.get(i);
     								 %>
     										<option value="<%=productTypeManager.getProductType() %>" ><%=productTypeManager.getTypeName() %></option>
     								<%
     									}
     								 %>
                         		<%}else{ %>
                         		 <option value="">---全部---</option>
     <%							for(int i=0;i<bidTypeList.size();i++){
     									ProductTypeManager productTypeManager = (ProductTypeManager)bidTypeList.get(i);
     								 %>
     										<option value="<%=productTypeManager.getProductType() %>"  <%if(productTypeManager.getProductType().equals(String.valueOf(productType))) {%> selected="selected"<%} %> ><%=productTypeManager.getTypeName() %></option>
     								<%
     									}
     								 %>
                         		<%} %>
                         	
                         	</select>

                    </td>                  
                </tr>
                    <tr height=20>
                   <td class="bg_column" align=center>有无图片</td>
                  <td align=left class="bg_row_odd" >
                  <select name="isPic">
                    <option value="">---全部---</option>
                    
                    
                    <%String tGsIsPic = (String)request.getParameter("isPic");
                    if(tGsIsPic==null){%>
                        <option value="1">是</option>
                        <option value="0">否</option>
                    <%}else{
                    
                    String[][] tIspic = GSBaseManager.getAllisbuy();
                    if(tIspic != null && tIspic.length > 0 ){
                    
                        for(int i=0; i<tIspic.length; i++){
                                    String[] temp = tIspic[i];
                                    if(tGsIsPic != null && tGsIsPic.equals(temp[0])){
                        %>
                                        <option value="<%=temp[0]%>" selected>
                                        <%=temp[1]%></option>
                        <%                  
                                    }else{
                        %>
                                        <option value="<%=temp[0]%>" >
                                        <%=temp[1]%></option>
                        <%          
                                    }
                                }
                            }
                        }
                        %>
                    
                  </select> 
                  </td>
                  <td class="bg_column" align=center>是否允许压库出库</td>
                  <td align=left class="bg_row_odd" >
                  <select name="isYkCk">
                    <option value="">---全部---</option>
                    
                    
                    <%String tisYkCk = (String)request.getParameter("isYkCk");
                    if(tisYkCk==null){%>
                        <option value="1">是</option>
                        <option value="0">否</option>
                    <%}else{
                    
                    String[][] tisYkCks = GSBaseManager.getAllisbuy();
                    if(tisYkCks!= null &&tisYkCks.length > 0 ){
                    
                        for(int i=0; i<tisYkCks.length; i++){
                                    String[] temp = tisYkCks[i];
                                    if(tisYkCk != null && tisYkCk.equals(temp[0])){
                        %>
                                        <option value="<%=temp[0]%>" selected>
                                        <%=temp[1]%></option>
                        <%                  
                                    }else{
                        %>
                                        <option value="<%=temp[0]%>" >
                                        <%=temp[1]%></option>
                        <%          
                                    }
                                }
                            }
                        }
                        %>
                    
                  </select> 
                  </td>
				</tr>
			</table>
            <br/>
            <div align="center">
             <input id="searchBtn" type="button" class="kuang" width="58" height="24" value="查询" onclick="process()"/>&nbsp;
              <input type="button" class="kuang" width="58" height="24" value="清空" onclick="clean()"/>&nbsp;
            </div>
		</td>
	</tr>
</table>
<br>
<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr> 
		<td> 
			<table class=bg_table id=tableId	cellspacing=1 cellpadding=0 style="padding-left:5;padding-right:5" width=100% align=center border=0>
				<TR height=20>
					<td class="bg_column" align=center width="98">关 键 字</td>
					<td align=left class="bg_row_odd"><input type="text" name="keyword" value="<%=request.getParameter("keyword")==null?"":request.getParameter("keyword")%>"></td>	
					<td class="bg_column" align=center colspan=2>
						<input type="button" class="kuang" value='查询' onclick="processkey()"/>&nbsp;
						<FONT color="#ff0033"><FONT color="#000000">（</FONT>对产品名称、型号、规格、品牌、生产厂商、附加属性等六个关键字的模糊查询</FONT>）
						
					</td>
				</tr>

			</table>
		</td>
	</tr>
</table>
<%
if(tGSManuf != null){
    int totalRecords = 0;
    if(request.getAttribute("totalRecords")!=null){
        totalRecords=Integer.parseInt((String)request.getAttribute("totalRecords"));
    }
    int defaultPageSize =10;
    if(request.getAttribute("pageSize")!=null){
        defaultPageSize=Integer.parseInt((String)request.getAttribute("pageSize"));
    }
    
%>          
<page:pager total='<%=totalRecords%>' defaultPageSize='<%=defaultPageSize%>'></page:pager>
<%} %>
</form>
<%
	if(tGSManuf != null){
%>
	<center>
    <table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
		<tr>
			<td> 
            <form name='pager' method="post">
       	    <input type="hidden" name="optype">
            <input type="hidden" name="param">
            	<table class=bg_table id=tableId	cellspacing=1 cellpadding=2 width=100% align=center border=0>
                    <tbody> 
                        <%
                            if(isPlanPrice.equals("1")){
                        %>
                            <tr class="bg_column" height=20><td align="right" colspan="23"><input type="button" class="kuang" width="58" height="24" value="导出EXCEL" onclick="downExcel();"/></td></tr>
                    
                        <%}else{ %>
                            <tr class="bg_column" height=20><td align="right" colspan="22"><input type="button" class="kuang" width="58" height="24" value="导出EXCEL" onclick="downExcel();"/></td></tr>
                        <%}%>
                    <tr class="bg_column" height=20> 

                        <td class=top align="center"> 
						<div class="txt_content" align="center"><input type="checkbox" name="ckbox" onClick="SelectAllCheckBox()"></div>
						</td>
            
						<td class=top align="center"> 
                        <div align="center" class="txt_content"></div>
						</td>
						
						<td class=top align="center"> 
                        <div align="center" class="txt_content">产品缩略图</div>
						</td>

                        <td class=top align="center"> 
                        <div align="center" class="txt_content">集中编码</div>
						</td>
            
						<td class=top align="center"> 
                        <div align="center" class="txt_content">产品编号</div>
						</td>
            
                        <td class=top align="center"> 
                        <div align="center" class="txt_content">产品名称</div>
						</td>
						<td class=top align="center"> 
                        <div align="center" class="txt_content">供应商</div>
						</td>
            
						<td class=top align="center"> 
                        <div align="center" class="txt_content">价格(元)</div>
						</td>
						<%
                            if(isPlanPrice.equals("1")){
                        %>
						<td class=top align="center"> 
                        <div align="center" class="txt_content">进价(元)</div>
						</td>
                        <%} %>
                        <td class=top align="center"> 
                        <div align="center" class="txt_content">单位</div>
                        </td>
                        
						<td class=top align="center"> 
                        <div align="center" class="txt_content">质保期(天)</div>
						</td>  
						<td class=top align="center"> 
                        <div align="center" class="txt_content">质保期(公里)</div>
						</td>              
                        <td class=top align="center"> 
                        <div align="center" class="txt_content">规格</div>
						</td>	
            																
                        <td class=top align="center"> 
                        <div align="center" class="txt_content">型号</div>
						</td>																																				
                       
                        <td class=top align="center"> 
                        <div align="center" class="txt_content">品牌</div>
						</td>
            
                        <td class=top align="center"> 
                        <div align="center" class="txt_content">生产厂商</div>
						</td>
                        
                        <td class=top align="center"> 
                        <div align="center" class="txt_content">结算模式</div>
                        </td>
                        
						<td class=top align="center"> 
                        <div align="center" class="txt_content">是否采购</div>
						</td>
						
						<td class=top align="center"> 
                        <div align="center" class="txt_content">是否到单车</div>
						</td>
						
						<td class=top align="center"> 
                        <div align="center" class="txt_content">产品录入时间</div>
						</td>
                        
                        <td class=top align="center"> 
                        <div align="center" class="txt_content">图件号</div>
                        </td>
						
						<td class=top align="center"> 
                        <div align="center" class="txt_content">所属仓库</div>
						</td>
																
                        <td class=top align="center"> 
                        <div align="center" class="txt_content">详细信息</div>
						</td>																							
					</tr>
					<%
						tList = tGSManuf.getAllRecoreds();
						if(tList != null && tList.size() > 0){
						for(int i=0; i<tList.size(); i++){
							tStr = (String[])tList.get(i);
							String tTempStr="";
							if(i%2==0){
								tTempStr="class=\"bg_row_odd\"";
							}else {
								tTempStr="class=\"bg_row_even\"";
							}
					%>
							<tr <%=tTempStr%> height=20>
								<td class=top align="center"> 
									<input type=checkbox id='checkboxs<%=i%>' name="sel_manufacture" value="<%=tStr[0] + "%" + tStr[18]+ "%"+ tStr[19]+ "%" + tStr[21]+ "%" + tStr[13]+"%"+tStr[22]+"%"+tStr[1]%>" onclick="checkSelect();">
								</td>
                                <td class=top align="center"> 
									<div align="center" class="txt_content">
									<%if(tStr[1].length()!=16){ %>
									     
										<input type="button" value="修改" class="kuang" onClick="mod('<%=tStr[0]%>')">
                                    <%} %>
									</div>
								</td>
								
								<td class=top align="center"> 
								<img src="/gw/servlet/ProductPictureShowServlet?productCode=<%=tStr[1]%>" height="40" width="40"/>
								</td>	

								<td class=top align="center"> 
									<div align="center" class="txt_content">
									<%=tStr[1]%>
									</div>
								</td>	
								<td class=top align="center"> 
									<div align="center" class="txt_content">
									<%=tStr[0]%>
									</div>
								</td>								
								<td class=top align="center"> 
									<div align="center" class="txt_content">
									<a href=""  onclick="javascript:viewWinMaxWindow('<%= response.encodeURL(request.getContextPath() + "/A400308.do") %>?manufactureId=<%=tStr[0]%>&concentricityId=<%=tStr[1]%>');return false;"  target="_blank"><%=tStr[2]%></a>
									</div>
								</td>	
								<td class=top align="center"> 
									<div align="center" class="txt_content">
									
									<a href="<%= response.encodeURL(request.getContextPath() + "/A400108.do") %>?providerId=<%=tStr[14]%>" target="contentForm">
									<%=tStr[15]%>
									</a>
									<%if(tStr[13].equals("0")&&tStr[16].equals("0")){ %>
									（采购网配送）
									<%} %>
									</div>
								</td>							
								<td class=top align="center"> 
									<div align="center" class="txt_content">
									<%=tStr[10]%>
									</div>
								</td>
                                <%
                                    if(isPlanPrice.equals("1")){
                                %>
                                <td class=top align="center"> 
                                    <div align="center" class="txt_content">
                                    <%=tStr[25]%>
                                    </div>
                                </td>
                                <%} %>
								<td class=top align="center"> 
									<div align="center" class="txt_content">
									<%=tStr[9]%>
									</div>
								</td>
								<td class=top align="center"> 
									<div align="center" class="txt_content">
									<%=tStr[11]%>
									</div>
								</td>	
								<td class=top align="center"> 
									<div align="center" class="txt_content">
									<%=tStr[26]%>
									</div>
								</td>	
								<td class=top align="center"> 
									<div align="center" class="txt_content">
									<%=tStr[7]%>
									</div>
								</td>								
								<td class=top align="center"> 
									<div align="center" class="txt_content">
									<%=tStr[6]%>
									</div>
								</td>	
                
																							
								<td class=top align="center"> 
									<div align="center" class="txt_content">
									<%=tStr[4]%>
									</div>
								</td>	
                
                
								<td class=top align="center"> 
									<div align="center" class="txt_content">
									<%=tStr[5]%>
									</div>
								</td>
                
                                <td class=top align="center"> 
                                    <div align="center" class="txt_content">
                                    <%=tStr[21]%>
                                    </div>
                                </td>   
                                
								<td class=top align="center"> 
									<div align="center" class="txt_content">
									<%if(tStr[18].equals("1")){ %>
									是
									<%}else if(tStr[18].equals("0"))
									{%>
									否
									<%}else
									{%>
									无
									<%}%>
									</div>
								</td>	
								<td class=top align="center"> 
									<div align="center" class="txt_content">
									<%if(tStr[27].equals("0")){ %>
									是
									<%}else if(tStr[27].equals("1"))
									{%>
									否
									<%}else
									{%>
									无
									<%}%>
									</div>
								</td>	
                        		<td class=top align="center"> 
									<div align="center" class="txt_content">
									<%=tStr[20]%>
									</div>
								</td>
                                
                                <td class=top align="center"> 
                                    <div align="center" class="txt_content">
                                    <%=tStr[17] %>
                                    </div>
                                </td>
								
								<td class=top align="center"> 
									<div align="center" class="txt_content">
									<%=tStr[24] %>
									</div>
								</td>
								<td class=top align="center"> 
									<div align="center" class="txt_content">
									<a  href="" onclick="javascript:viewWinMaxWindow('<%= response.encodeURL(request.getContextPath() + "/A400308.do") %>?manufactureId=<%=tStr[0]%>&concentricityId=<%=tStr[1]%>');return false;" target="_blank">详细</a>
									</div>
								</td>																	
							</tr> 
							
					<%	
							}
					%>
						  <tr class="bg_column" height=20>
                          <%
                            if(isPlanPrice.equals("1")){
                        %>
                            <td width="960" height="16" colspan="23" align="right">                    
                        <%}else{ %>
                            <td width="960" height="16" colspan="22" align="right">
                        <%}%>
						    
									<!--导航条-->
									<page:navigator type='text' queryForm="manufactureform"/>
						    </td>
                          </tr>
						  
				    <%
						}else{
					%>
                            <%
                                if(isPlanPrice.equals("1")){
                            %>
							<tr class="bg_column" height=20>
                            <td width="960" height="16" colspan="23" align="center">
                                <font color="red">没有符合条件的产品信息</font></td>
                            </tr>
                            <%}else{ %>
                            <tr class="bg_column" height=20>
                            <td width="960" height="16" colspan="22" align="center">
                                <font color="red">没有符合条件的产品信息</font></td>
                            </tr>
                            <%}%>
					<%
						}
					%>
                    
					</tbody>
				</table>
				</form>					  
			</td>
		</tr>
		<tr>
			<td align=center>

				 <!-- <input type="button" class="kuang" width="58" height="24" value="设置为采购" onclick="setIsbuy(1)"/>
                <input type="button" class="kuang" width="58" height="24" value="设置为不采购" onclick="setIsbuy(0)"/>-->
                        <%
                            if(isPlanPrice.equals("0")){
                        %>
                            <input type="button" class="kuang" width="58" height="24" value="设置为压库模式" onclick="changeBalanceMode(<%=GSBaseConstants.BALANCE_MODE1 %>)"/>
                            <input type="button" class="kuang" width="58" height="24" value="设置为买断模式" onclick="changeBalanceMode(<%=GSBaseConstants.BALANCE_MODE2 %>)"/>
                        <%}%>
                <!-- <input type="button" class="kuang" width="58" height="24" value="设置为有效" onclick="setValidate(1)"/>
                <input type="button" class="kuang" width="58" height="24" value="设置为无效" onclick="setValidate(0)"/> -->
                <%
                if("true".equalsIgnoreCase(ma)){
                %>
                <input type="button" class="kuang" width="58" height="24" value="添加产品" onclick="setaddmanu();"/>
                <input type="button" class="kuang" width="58" height="24" value="产品批量修改" onclick="modifyAll();"/>
                <input type="button" class="kuang" width="58" height="24" value="临时产品集中编码替换批量修改或增加" onclick="modifyTemporaryAll();"/>
               <!--  <input type="button" class="kuang" width="58" height="24" value="批量导入产品供应商分类修改或添加" onclick="modifyProductType();">
                 <input type="button" class="kuang" width="58" height="24" value="招标类产品批量修改或增加" onclick="modifyProductBid();">
 				
                <input type="button" class="kuang" width="58" height="24" value="正式产品集中编码替换批量修改或增加" onclick="modifyInSteadTemporary();">-->
			    <%} %>
            </td>
		</tr>
	</table>
	</center>
<%		
	}
%>
<script>
    function changeBalanceMode(input) {
        var checkboxvalue = document.getElementsByName("sel_manufacture");
        var selectnum = 0;
        for(i=0;i<checkboxvalue.length;i++){
            if(checkboxvalue[i].checked){
              var Paradata = checkboxvalue[i].value.split("%");
              if(Paradata[0].length ==16) {
                  alert("16位临时产品不能设置结算模式！");
                  return false;
              }
             selectnum++;
            }
        }
        if(selectnum ==0) {
            alert("请至少选择一项产品");
            return false;
        }
        if(confirm("是否确定修改此些产品的结算模式？")){
            var rootURL = "<%=response.encodeURL(request.getContextPath()+"/A400309.do")%>";
            document.pager.action = encodeURI(rootURL);
            document.pager.optype.value="1";
            document.pager.param.value=input;
            document.pager.submit();
        }
    }
        function setProductType(input) {
        alert(document.getElementById('productType').text)
        var checkboxvalue = document.getElementsByName("sel_manufacture");
        var selectnum = 0;
        for(i=0;i<checkboxvalue.length;i++){
            if(checkboxvalue[i].checked){
             	selectnum++;
             }
        }
        if(selectnum ==0) {
            alert("请至少选择一项产品");
            return false;
        }
        
        if(confirm("是否确定保存或修改此些产品的供应商分类？")){
            var rootURL = "<%=response.encodeURL(request.getContextPath()+"/A400309.do")%>";
            document.pager.action = encodeURI(rootURL);
            document.pager.optype.value="4";
            var obj = document.getElementById('productType').value;
            document.pager.param.value=obj;
            document.pager.submit();
        }
    }
    
    function setIsbuy(input) {
        var checkboxvalue = document.getElementsByName("sel_manufacture");
        var selectnum = 0;
        for(i=0;i<checkboxvalue.length;i++){
            if(checkboxvalue[i].checked){
             selectnum++;
             var Paradata = checkboxvalue[i].value.split("%");
              if(Paradata[0].length ==16) {
                  alert("16位临时产品不能设置此操作！");
                  return false;
              }
            }
        }
        if(selectnum ==0) {
            alert("请至少选择一项产品");
            return false;
        }
        
        if(confirm("是否确定修改此些产品的采购标志？")){
            var rootURL = "<%=response.encodeURL(request.getContextPath()+"/A400309.do")%>";
            document.pager.action = encodeURI(rootURL);
            document.pager.optype.value="2";
            document.pager.param.value=input;
            document.pager.submit();
        }
    }
    
    function setValidate(input) {
        var checkboxvalue = document.getElementsByName("sel_manufacture");
        var selectnum = 0;
        for(i=0;i<checkboxvalue.length;i++){
            if(checkboxvalue[i].checked){
              var Paradata = checkboxvalue[i].value.split("%");
              if(Paradata[4] !='2') {
                  alert("只能针对非网上产品进行有效性设置！");
                  return false;
              }
             selectnum++;
            }
        }
        if(selectnum ==0) {
            alert("请至少选择一项产品");
            return false;
        }
        if(confirm("是否确定修改此些产品的有效性？")){
            var rootURL = "<%=response.encodeURL(request.getContextPath()+"/A400309.do")%>";
            document.pager.action = encodeURI(rootURL);
            document.pager.optype.value="3";
            document.pager.param.value=input;
            document.pager.submit();
        }
    }    
    
    function checkSelect(){
        var c = document.getElementsByName('sel_manufacture');
        
        for(var i=0; i<c.length; i++){
            if(!c[i].checked)
                break;
        }
        if(i<c.length){
            document.getElementById('ckbox').checked = false;
        } else {
            document.getElementById('ckbox').checked = true;
        }
    }
    
    function SelectAllCheckBox() {
        var des =document.getElementsByName('sel_manufacture');
        for(var i=0;i<des.length;i++) {
           if(des[i].checked=document.getElementById('ckbox').checked){
               des[i].checked=true;
           } else { 
               des[i].checked=false;
           }
        }
    }
    function setaddmanu()
    {
       window.open("<%= response.encodeURL(request.getContextPath() + "/A400313.do")%>");
    }
        function modifyAll()
    {
       window.open("<%= response.encodeURL(request.getContextPath() + "/jsp/sysmaintain/manfactureMoreModify.jsp")%>");
    }
     function modifyTemporaryAll()
    {
       window.open("<%= response.encodeURL(request.getContextPath() + "/jsp/sysmaintain/temporaryProductModify16To14.jsp")%>");
    }
    
     function modifyProductType()
    {
       window.open("<%= response.encodeURL(request.getContextPath() + "/jsp/sysmaintain/temporaryProductModifyProductType.jsp")%>");
    }
    
    function modifyInSteadTemporary()
    {
       window.open("<%= response.encodeURL(request.getContextPath() + "/jsp/sysmaintain/temporaryProductModify14To13.jsp")%>");
    }
    
    function modifyProductBid()
    {
       window.open("<%= response.encodeURL(request.getContextPath() + "/jsp/sysmaintain/productModifyProductBid.jsp")%>");
    }
    
 </script>
 <form name="manufacturemod" method="post">
<input type="hidden" name="manuftype4">
<input type="hidden" name="manuftype5">
<input type="hidden" name="manuftype6">
<input type="hidden" name="manufacturecode">
<input type="hidden" name="concentricityid">
<input type="hidden" name="manufacturename">
<input type="hidden" name="providerid">
<input type="hidden" name="unitprice">
<input type="hidden" name="quantunit">
<input type="hidden" name="manufacturetype">
<input type="hidden" name="manfuacturespec">
<input type="hidden" name="qualityassureperiod">
<input type="hidden" name="manufacturername">
<input type="hidden" name="makearea">
<input type="hidden" name="manufacturebrand">
<input type="hidden" name="drawingpiececode2">
<input type="hidden" name="isbuy2">
<input type="hidden" name="machinetype">
<input type="hidden" name="property">
<input type="hidden" name="remark">
<input type="hidden" name="mode2">
<input type="hidden" name="concentricity_code_back">
<input type="hidden" name="planprice">
<input type="hidden" name="uppertype"/>
<input type="hidden" name="producttype">
<input type="hidden" name="productbid">
<input type="hidden" name="kmqualityassureperiod">
<input type="hidden" name="balancecustomercode">
<input type="hidden" name="pic">
</form>
</body>
</html>